/**
 * @author gxl
 */
// 注册
function register() {
    smsVerify.register(function (ret, err) {
        if (ret.status) {
            //api.alert({msg: '注册成功'});
            console.log("注册成功");
        } else {
            api.alert({ msg: err.code + " 注册失败" });
        }
    });
}

// 发语音验证码
function voice() {
    var phone = document.getElementById("mobile").value;
    smsVerify.voice(
        {
            phone: phone,
        },
        function (ret, err) {
            if (ret.status) {
                api.alert({ msg: "语音发送成功" });
            } else {
                api.alert({ msg: err.code + " 语音发送失败" });
            }
        },
    );
}

function play_force_stop() {
    recordStatus = 0;
    var jsfun1 = "stop();";
    api.execScript({
        frameName: "frm",
        script: jsfun1,
    });
    $api.attr(
        $api.byId("play_record"),
        "src",
        "../../../../image/stageTabBar/play.png",
    );
}
function record_force_stop() {
    // recordStatus = 0;
    // var jsfun1 =  'stop();';
    // api.execScript({
    //     frameName: 'frm',
    //     script: jsfun1
    // });
    // $api.attr($api.byId('play_record'), 'src', "../../../../image/recorder_default.png");
    if ($api.getStorage("record_stop_flag") == "false") {
        api.toast({
            msg: "请点击录音按钮结束录音,或者等待录音自动结束.",
            duration: 2000,
            location: "bottom",
        });
        return;
    }
}
